<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header','admin');?>
<script type="text/javascript" src="<?php echo JS_PATH?>jquery.sgallery.js"></script>
<script type="text/javascript" src="<?php echo JS_PATH?>qrcode/jquery-1.11.1.js" ></script>
<script type="text/javascript" src="<?php echo JS_PATH?>qrcode/jquery.qrcode.js" ></script>
<script type="text/javascript" src="<?php echo JS_PATH?>qrcode/qrcode.js" ></script> 
<script type="text/javascript" src="<?php echo JS_PATH?>qrcode/utf.js" ></script>
<script>
    function change_color_over(title_id){
    	$("#"+title_id).css('color',"blue");
    }
    function change_color_out(title_id){
    	$("#"+title_id).css('color',"black");
    }
</script>
<div class="pad-lr-10">
<div class="table-list">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
			 <th width="30">ID</th>
            <th width="150"><?php echo L('reg_title');?></th>
			<th width="80"><?php echo L('reg_title_image');?></th>
            <th width="150"><?php echo L('info_description');?></th>
            <th width="80"><?php echo L('source_type');?></th>
            <th width="60"><?php echo L('reg_items');?></th>
            <th width="60">报名数</th>
            <th width="100">二维码</th>
            <th width="80">上次编辑者</th>
			<th width="150"><?php echo L('operations_manage');?></th>
            </tr>
        </thead>
    <tbody>
	<?php
	if(!empty($datas)) {
	foreach($datas as $r) {
	?>
    <tr>
		<td align='center'><?php echo $r['id']?></td>
		<td align='center'><a href="http://m.nsr.com.cn/xinsilu/v1/reg/toRegJsp?regTableInfoId=<?=$r['id']?>" id="title_<?php echo $r['id'];?>" target="_blank" onmouseover="change_color_over('title_'+<?php echo $r['id'];?>)" onmouseout="change_color_out('title_'+<?php echo $r['id'];?>)" title="点击可预览：<?php echo $r['title'];?>报名"><?php echo $r['title']?></a></td>
		<td align='center'><?php if ($r['title_image']){ ?><img src="<?php echo $r['title_image'];?>" height="60"/><?php }else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align='center' title="<?=$r['info_description']?>">&nbsp;<?php echo $r['info_description']?str_cut($r['info_description'],120):'<font color="red">（未设置）</font>';?></td>
		<td align='center'><?php echo $r['source_type']?$reg_type[$r['source_type']]:'<font color="red">（未设置）</font>';?></td>
		<td align='center'><strong><?=$r['num']?></strong>&nbsp;个</td>
		<td align='center'><strong><?=$r['nums']?></strong>&nbsp;个</td>
		<td align="center"><a href="javascript:;" onclick="preview('http://m.nsr.com.cn/xinsilu/v1/reg/toRegJsp?regTableInfoId=<?=$r['id']?>')" title="点击生成<?php echo $r['title'];?>报名的二维码！">生成二维码</a></td>
		<td align='center'><?php echo $adminInfo[$r['updated_by']];?></td>
		<td align='center'><a href="?m=sign_up&c=reg&a=fields&id=<?php echo $r['id']?>&pc_hash=<?=$_SESSION['pc_hash']?>"><?php echo L('field_manage');?></a> | 
		<a href="javascript:edit('<?php echo $r['id']?>','<?php echo addslashes($r['title']);?>')"><?php echo L('edit');?></a> |<!-- | 
		<a href="?m=sign_up&c=reg&a=delete&id=<?php echo $r['id']?>&pc_hash=<?=$_SESSION['pc_hash']?>" onClick="return confirm('<?php echo L('confirm', array('message' => new_addslashes($r['title'])))?>')"><?php echo L('delete')?></a> --> 
		<a href="?m=sign_up&c=reg&a=reg_statistics&res_id=<?php echo $r['id']?>&pc_hash=<?=$_SESSION['pc_hash']?>"><?php echo L('reg_statistics');?></a>
		</td>
		
	</tr>
	<?php } 

	} else {
		echo "<tr><td colspan='9' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>";
		}?>
    </tbody>
    </table>
   <div id="pages"><?php echo $pages;?>
  </div>
</div>
<div id="qrCodeDiv"></div>
<script type="text/javascript"> 
<!--
window.top.$('#display_center_id').css('display','none');
function edit(id, name) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'修改《'+name+'》',id:'edit',iframe:'?m=sign_up&c=reg&a=edit&pc_hash=<?=$_SESSION["pc_hash"]?>&id='+id,width:'580',height:'420'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
function model_delete(obj,id,name,items){
	if(items) {
		alert('<?php echo L('model_does_not_allow_delete');?>');
		return false;
	}
	window.top.art.dialog({content:name, fixed:true, style:'confirm', id:'model_delete'}, 
	function(){
	$.get('?m=content&c=sitemodel&a=delete&modelid='+id+'&pc_hash='+pc_hash,function(data){
				if(data) {
					$(obj).parent().parent().fadeOut("slow");
				}
			}) 	
		 }, 
	function(){});
};
function preview(url) {
	
	window.top.art.dialog({title:'二维码',fixed:true, iframe:'?m=sign_up&c=reg&a=qrcode&url='+url+'&pc_hash=<?=$_SESSION["pc_hash"]?>',width:'300',height:'210'});	

}
//-->
</script>
</body>
</html>
